﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PrototypeClient
{
    class Program
    {
        static void Main(string[] args)
        {
            AbstractHero mainHero = new Meepo();
            Console.WriteLine(mainHero.DicProp["prop"]);
            // 进行一个浅复制
            AbstractHero heroWiseCopy = mainHero.MemberwiseCloneHero();
            heroWiseCopy.DicProp["prop"] = ((int)mainHero.DicProp["prop"]) * 0.3;
            Console.WriteLine(heroWiseCopy.DicProp["prop"]);
            Console.WriteLine(mainHero.DicProp["prop"]);

            // 进行一个浅复制
            AbstractHero deppCopy = mainHero.DeepClone();
            deppCopy.DicProp["prop"] = Convert.ToInt32(mainHero.DicProp["prop"]) * 0.3;

            Console.WriteLine(deppCopy.DicProp["prop"]);
            Console.WriteLine(mainHero.DicProp["prop"]);

        }
    }
}
